package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/*
 * 题目种类枚举
 * */
@Getter
public enum SubjectTypeEnum {
    RADIO(1, "单选题"),
    MULTIPLE(2, "多选题"),
    JUDGE(3, "判断题"),
    BRIEF(4, "简答题");

    public int code;

    public String desc;

    SubjectTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectTypeEnum getByCode(int codeVal) {
        for (SubjectTypeEnum subjectTypeEnum : SubjectTypeEnum.values()) {
            if (subjectTypeEnum.getCode() == codeVal) {
                return subjectTypeEnum;
            }
        }
        return null;
    }
}
